from django.contrib.auth.mixins import LoginRequiredMixin
from django import http


class LoginJsonRequiredMixin(LoginRequiredMixin):
    def handle_no_permission(self):
        return http.JsonResponse({'errno': 0, 'errmsg': '未登录'})